<core:SET width='200'>
<core:SET teamstats="teamstats">

<core:SET title="Teams management">
<core:WRAP file="/adm/adm.layout.html" placeholder="Content">

<core:include file="/adm/inc/inc.adm.tabs.html">

<h1 align="center">Teams</h1>



<form id="FilterForm" name="FilterForm" method="post" action="" runat="server">
	<core:optional for="msg">
		<span class="message" runat="server"> {$msg} </span>
	</core:optional>
	<hr>

 <!-- divisions filter -->
 <table width="100%" border="0" align="center" cellspacing="1" cellpadding="2">
 	<tr>
 		<td>
        	<table width="100%" border="0" align="center" cellspacing="1" cellpadding="2">
                <tr valign="top">
      				<td class="form_field" width="25%">
                        <input name="filter_team_id" type="checkbox" id="filter_team_id" value="team_id" runat="server">
      					<label for="team_id" runat="server">ID:</label>
      				</td>
      				<td class="form_field">
      					<input name="team_id" type="text" id="team_id" size="10" runat="server">
      				</td>
    			</tr>
                <tr valign="top">
      				<td class="form_field">
                        <input name="filter_title" type="checkbox" id="filter_title" value="filter_title" runat="server">
      					<label for="title" runat="server">Title:</label>
      				</td>
      				<td class="form_field">
      					<input name="title" type="text" id="title" size="56" runat="server">
      				</td>
    			</tr>
    			<tr valign="top">
      				<td class="form_field">
                        <input name="filter_division_id" type="checkbox" id="filter_division_id" value="filter_division_id" runat="server">
      					<label for="division_id" runat="server">Division:</label>
      				</td>
      				<td class="form_field">
                        <select name="division_id" id="division_id" runat="server">
                        </select>
      				</td>
    			</tr>


        	</table>
 		</td>
 		<td>
        	<table width="100%" border="0" align="center" cellspacing="1" cellpadding="2">

                <tr valign="top">
      				<td class="form_field">
      					<label for="sort" runat="server">Sort By:</label>
      				</td>
      				<td class="form_field">
                        <select name="sort" id="sort" runat="server">
                        </select>
      				</td>
    			</tr>
                <tr valign="top">
      				<td class="form_field" colspan="2">
                     	<input name="apply" type="submit" id="apply" value="List teams" runat="server">
      				</td>
    			</tr>

        	</table>
 		</td>
 	</tr>
 </table>

  <!-- teams list -->
  <table width="100%" border="0" align="center" cellspacing="1" cellpadding="2">
    <colgroup>
        <col id="ID">
        <col id="name">
        <col id="division">
        <col id="WLT">
        <col id="pct">
        <col id="date_added">
        <col id="action">
    </colgroup>
    <tr align="left">
    	<td colspan="3" class="whiteheader">
    		Manage teams
		</td>

<list:LIST id='List'>
        <td colspan="4" class="whiteheader_right" align="right">
            <page:navigator id="pagenav" items="10">
				Page: {$PageNumber} of {$TotalPages}
    			<page:first>First</page:first>
    			<page:prev>Prev</page:prev>
    			<page:list>
        			<page:number>
        			<page:elipses>...</page:elipses>
        			<page:separator> </page:separator>
    			</page:list>
    			<page:next>Next</page:next> <page:last>Last</page:last>
			</page:navigator>
    	</td>
     </tr>

    <tr class="header">
        <th>ID</th>
        <th>Team name</th>
        <th>Division name</th>
        <th>W-L-T</th>
        <th>Pct</th>
        <th>Date posted</th>
        <th> &nbsp; </th>
    </tr>
    <list:ITEM>
      <tr class="{$Parity}">
        <td class="{$status_show}">
        	{$teamID}
        </td>
        <td class="{$status_show}">{$teamName}</td>
        <td class="{$status_show}">
        <core:optional for="leagueName">
        {$leagueName}-
        </core:optional>
        {$divisionName}</td>
        <td class="{$status_show}">{$wins}-{$losses}-{$ties}</td>
        <td class="{$status_show}">{$pct}</td>
        <td class="{$status_show}">{$date_added}</td>

        <td class="left">
        	<html:link url="/delete" param="teamID">Delete</html:link>
        	<html:link url="/edit" param="teamID">Edit</html:link>
        	<core:optional for="enabled_show">
        		<html:link url="/deactivate" param="teamID">Disable</html:link>
        	</core:optional>
            <core:default for="enabled_show">
        		<html:link url="/activate" param="teamID">Enable</html:link>
        	</core:default>
        </td>
      </tr>
    </list:ITEM>

    <!--<tr> <td colspan="6" class="whiteheader"> &nbsp; </td> </tr> -->
    <tr align="left">
    	<td colspan="3" class="whiteheader">
    		Manage teams
		</td>

        <td colspan="4" class="whiteheader_right" align="right">
            <page:navigator id="pagenav2" items="10">
				Page: {$PageNumber} of {$TotalPages}
    			<page:first>First</page:first>
    			<page:prev>Prev</page:prev>
    			<page:list>
        			<page:number>
        			<page:elipses>...</page:elipses>
        			<page:separator> </page:separator>
    			</page:list>
    			<page:next>Next</page:next> <page:last>Last</page:last>
			</page:navigator>
    	</td>
     </tr>
  </table>
</list:LIST>
<!--</core:default>   -->

<hr>

<html:link url="/create" param="teamID">Create a new team</html:link>

</form>